import tkinter as tk

n1 = 14
n2 = 10
ipx = 2

numList = ["123", "456", "789", "-0."]

top = tk.Tk()

top.title('计算器')
top.resizable(False, False)
display = tk.Label(top, text = '0', relief = tk.SUNKEN, anchor='w')
display.pack(side = tk.TOP, fill = tk.X)

for num in numList:
    line = tk.Frame(top)
    line.pack(side = tk.TOP, fill = tk.X)
    for c in num:
        btn = tk.Button(line, text = c, width = n1)        
        btn.pack(side = tk.LEFT, ipadx = ipx)

line5 = tk.Frame(top)
line5.pack(side = tk.TOP, fill = tk.X)
btnPlus = tk.Button(line5, text = '+', width = n2)
btnPlus.pack(side = tk.LEFT, ipadx = ipx)
btnMinius = tk.Button(line5, text = '-', width = n2)
btnMinius.pack(side = tk.LEFT, ipadx = ipx)
btnMul = tk.Button(line5, text = '*', width = n2)
btnMul.pack(side = tk.LEFT, ipadx = ipx)
btnDiv = tk.Button(line5, text = '/', width = n2)
btnDiv.pack(side = tk.LEFT, ipadx = ipx)

line6 = tk.Frame(top)
line6.pack(side = tk.TOP, fill = tk.X)
btnClear = tk.Button(line6, text = 'clear')
btnClear.pack(side = tk.LEFT, fill = tk.X, expand = tk.TRUE)

top.mainloop()